package com.shycloud.mido.basic.api.feign;

import com.shycloud.mido.basic.api.dto.DictionaryDTO;
import com.shycloud.mido.common.core.constant.SecurityConstants;
import com.shycloud.mido.common.core.constant.ServiceNameConstants;
import com.shycloud.mido.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 字典查询接口
 *
 * @author yyy
 * @date 2019/2/28
 */
@FeignClient(value = ServiceNameConstants.BASIC_MOBILE_SERVICE)
public interface DictionaryService {

	/**
	 * 字典查询接口
	 *
	 * @param dto
	 * @param from
	 * @return
	 */
	@PostMapping("/dictionary/sel")
	R<Boolean> saveLog(@RequestBody DictionaryDTO dto, @RequestHeader(SecurityConstants.FROM) String from);

	/**
	 * 查询字典 label
	 *
	 * @param type  字典类别
	 * @param value 数据值
	 * @return
	 */
	@PostMapping("/dictionary/getDic")
	String getDic(@RequestParam("type") String type, @RequestParam("value") String value);

	@PostMapping("/dictionary/getDicMap")
	Map<String, Map<String, String>> getDicMap(@RequestBody List<String> types);

}
